package top.humbleyuan.designmode.observer;

/**
 * @Author HumbleYuan
 * @Date 2019/12/18 19:18
 * @Des 学生类模拟观察者
 */
public class Student implements Observer {
    private String msg;
    private String name;

    public Student(String name) {
        this.name = name;
    }

    @Override
    public void update(String msg) {
        this.msg = msg;
        System.out.println("学生：" + this.name + "收到的新通知：" + this.msg);
    }
}
